package cn.edu.nit.sys.mapper;

import cn.edu.nit.sys.entity.Clazz;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author xiaobai
 * @Date 2022/11/27 13:13
 * @Version 1.0.0
 */
@Mapper
public interface ClazzMapper extends BaseMapper<Clazz> {

    Page<Clazz> getClazzList(Page<Clazz> page, String siftDept, String siftName);

    @Select("select a.id, a.name, (select count(1) from sys_student where major_id = a.major_id) as volume from sys_clazz a")
    List<Clazz> getAllClazz();

    int getCurSubjectVolume(String[] clazz, String year);
}
